﻿using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using TaskCaller.Models;

namespace TaskCaller.Repositories.SqlServer
{
    public abstract class BaseRepository
    {
        private readonly ConnectionStringsConfig connectionStrings;
        public BaseRepository(IOptions<ConnectionStringsConfig> options)
        {
            connectionStrings = options.Value;
        }

        protected SqlConnection Open()
        {
            return new SqlConnection(connectionStrings.SqlServer);
        }
    }
}
